
<load href="__JS__/swfupload.js"/>


<form name="myform" id="myform" action="{:U('Wap/updateblock')}" method="post">
    <input type="hidden" name="blockname" value="{$blockname}"/>
    <div class="panel-body">
    <textarea name="blockcontent" id="blockcontent" class="form-control">{$content}</textarea>
    </div>
    <div class="panel-footer">
        <input type="submit" value="提交" class="btn btn-sm btn-primary" >
        <input type="reset" value="取消" class="btn btn-sm btn-primary">
    </div>
</form>

<script type="text/javascript" src="__STATIC__/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">

KindEditor.create('#blockcontent', {
    cssPath : '/Public/static/kindeditor/plugins/code/prettify.css',
    fileManagerJson:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=20&file_types=jpg,jpeg,gif,png,doc,docx,rar,zip,swf&file_size=5&moduleid=1&auth=03665ip6E4YS7tgbxBytG3St0OYqJCJ+YYCEjMD8l0SEmHSncP0syRnWN6zyS1IOujglPW8GFwo882jnFjMQZVkRMUo+I0J5wmrTAltR0w&l=zh-cn',
    editorid:'content',
    upImgUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=gif,jpg,jpeg,png,bmp&file_size=5&moduleid=1&auth=14caN5eAor2hNmI46GNASXi5wT+r7qytNH1DwLikZyUdxu4PFjSXbHqnDNNnIPdRsV6penfzRTmLhbVnQQ&l=zh-cn',
    upFlashUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=swf,flv&file_size=5&moduleid=1&auth=211ekeme5vPfm/xBs2vG2Wf78Wa058QEEDoSKvlFtbcfCvrYrD4weTUwonFc2cyG&l=zh-cn',
    upMediaUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=mpg,wmv,avi,wma,mp3,mid,asf,rm,rmvb,wav,wma,mp4&file_size=5&moduleid=1&auth=c55e5KSDQ++y/l9TdkJ681dz4/uSBALNN28De1TsVdDPR6ft8+4Drnqe1LzADJNU9eeO7zGqF/UrosP3lTE1ruI5su3g+yQe5iFueMzAmSpB2ekI+8M2uQ&l=zh-cn',
    allowFileManager : true,
    filterMode: false,
    hunqinglineTag:'br',
    items: ['source', '|', 'fullscreen', 'undo', 'redo', 'cut', 'copy', 'paste','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', '|', 'selectall', '-','title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold','italic', 'underline', 'strikethrough', 'removeformat', '|', 'image', 'advtable', 'hr', 'link', 'unlink'],
    afterBlur: function () { this.sync(); }
});

</script>

<script type="text/javascript">
$(document).ready(function() {
    $('#myform').ajaxForm({
        success:  complete,  // post-submit callback
        dataType: 'json'
    });
});

function complete(data){
    if(data.status==1){
        $.scojs_message('修改成功', $.scojs_message.TYPE_OK);
        setTimeout(function(){
            window.location.href = '{:U("Wap/preview")}';
        },1000);
    }else{
        $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
    }

}
</script>
